package org.example.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.example.entity.MyNotices;
import org.example.mapper.MyNoticesMapper;
import org.example.service.MyNoticesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

/**
 * @ClassName MyNoticesServiceImpl
 * @Description TODO
 * @Author qiuye
 * @Date 2025年08月15日 11:06
 * @Version 1.0
 */
@Service
public class MyNoticesServiceImpl implements MyNoticesService {
    @Autowired
    private MyNoticesMapper myNoticesMapper;
    @Override
    public PageInfo<MyNotices> getMyNotices(MyNotices myNotices, int pageNum, int pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        List<MyNotices> list = myNoticesMapper.getMyNotices(myNotices);
        PageInfo<MyNotices> pageInfo = new PageInfo<>(list);
        return pageInfo;
    }

    @Override
    public List<MyNotices> getMyNoticeById(int id) {
        List<MyNotices> myNoticeById = myNoticesMapper.getMyNoticeById(id);
        return myNoticeById;
    }
}
